<template>
  <div class="bb-bg">
    <div class="co-title">
      <div class="co-title-name">
        <img src="@/assets/cockpit/subdivision/approve/item2-title-text.png" alt="" />
      </div>
      <!-- <div class="co-title-right">
        <div class="co-title-breathe"><i></i><i></i><i></i><i></i><i></i><i></i></div>
      </div> -->
    </div>
    <div class="list-container-top">
      <div class="lf">
        <div class="title">正点率TOP5</div>
        <ul>
          <li v-for="(item, index) in list1" :key="index">
            <div class="name-area">
              <div class="index" :class="index > 2 ? 'index-2' : 'index-1'">{{ index + 1 }}</div>
              <div class="label">{{ item.departname }}</div>
            </div>

            <div class="num">{{ item.ontimerate }}%</div>
          </li>
        </ul>
      </div>
      <div class="lf">
        <div class="title">办结量TOP5</div>
        <ul>
          <li v-for="(item, index) in list2" :key="index">
            <div class="name-area">
              <div class="index" :class="index > 2 ? 'index-2' : 'index-1'">{{ index + 1 }}</div>
              <div class="label">{{ item.departname }}</div>
            </div>

            <div class="num">{{ item.finishnum }}</div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import { CockpitApi } from '@/api/cockpit'

@Component({
  name: 'Item2',
  components: {}
})
export default class Item2 extends Vue {
  private list1 = [
    // {
    //   label: '矿产管理处',
    //   num: '100'
    // },
    // {
    //   label: '市政交通处',
    //   num: '100'
    // },
    // {
    //   label: '建设项目审查一处',
    //   num: '100'
    // },
    // {
    //   label: '建设项目审查二处',
    //   num: '100'
    // },
    // {
    //   label: '建设项目审查三处',
    //   num: '100'
    // }
  ]
  private list2 = [
    // {
    //   label: '建设项目审查三处',
    //   num: '155'
    // },
    // {
    //   label: '建设项目审查四处',
    //   num: '135'
    // },
    // {
    //   label: '市政交通处',
    //   num: '120'
    // },
    // {
    //   label: '建设项目审查二处',
    //   num: '110'
    // },
    // {
    //   label: '自然资源权益处',
    //   num: '98'
    // }
  ]
  created() {
    this.initList1()
    this.initList2()
  }
  initList1() {
    CockpitApi.countDepartmentZdlTopFiveApi().then(res => {
      this.list1 = res.data || []
    })
  }
  initList2() {
    CockpitApi.countDepartmentBjlTopFiveApi().then(res => {
      this.list2 = res.data || []
    })
  }
}
</script>
<style lang="scss" scoped>
@import '~@/styles/cockpit.scss';
.bb-bg {
  width: 100%;
  height: 100%;
  padding: 22px 12px 8px;
  background: url('~@/assets/cockpit/subdivision/approve/item2-bg.png') no-repeat 0/ 100% 100%;
  .bpl-container {
    padding-top: 8px;
    overflow-x: hidden;
  }
}
.list-container-top {
  display: flex;

  justify-content: space-between;
  .lf {
    width: 46%;
    display: block;
    .title {
      font-size: 14px !important;
      color: #dffeff;
      margin-top: 12px;
    }
    ul {
      margin-top: 16px;
      width: 100%;
      li {
        display: flex;
        font-size: 12px !important;
        color: #fff;
        justify-content: space-between;
        margin-top: 10px;
        width: 100%;
        .name-area {
          display: flex;
          .index {
            width: 20px;
            height: 20px;
            line-height: 20px;
            text-align: center;
          }
          .label {
            margin-left: 4px;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 168px;
            overflow: hidden;
          }
          .index-1 {
            background: url('~@/assets/cockpit/subdivision/approve/item2-index-2.png') no-repeat 0/ 100% 100%;
          }
          .index-2 {
            background: url('~@/assets/cockpit/subdivision/approve/item2-index-1.png') no-repeat 0/ 100% 100%;
          }
          .label {
          }
        }
      }
    }
  }
}
</style>
